<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0;padding:0;
        }
        #box{
            width:100%;
            height: 200px;
            background:#eee;
        }
        html,body,#root{
            height: 100%;
            width: 100%;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div id="root">
        <div id="box">

        </div>
    </div>

    <script>
        let box = document.querySelector('#box');
        let root = document.querySelector('#root');
        root.addEventListener('touchstart', function(e){
            //阻止默认行为
            e.preventDefault();
        });


        box.addEventListener('touchstart', function(e){
            console.log(e.changedTouches);

            let str = `
                同时按下的触点的个数: ${e.changedTouches.length}<br/>
                事件源身上的触点个数: ${e.targetTouches.length}<br />
                屏幕上的总共触点个数: ${e.touches.length}<br />
            `;
            //设置
            this.innerHTML = str;
        });

        box.addEventListener('touchmove', function(e){
            this.style.background = '#aef';
            let str = `
                同时滑动的触点的个数: ${e.changedTouches.length}<br/>
                事件源身上的触点个数: ${e.targetTouches.length}<br />
                屏幕上的总共触点个数: ${e.touches.length}<br />
            `;
            //设置
            this.innerHTML = str;
        });

        box.addEventListener('touchend', function(e){
            this.style.background = '#fea';
            let str = `
                同时抬起的触点的个数: ${e.changedTouches.length}<br/>
                事件源身上的触点个数: ${e.targetTouches.length}<br />
                屏幕上的总共触点个数: ${e.touches.length}<br />
            `;
            //设置
            this.innerHTML = str;
        });

    </script>
</body>
</html>